package st.business.tepth.business.taskallocation;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.CommonPageBean;
import st.business.tepth.business.bean.TaskAllocationBean;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-02-26 10:30
 */

public interface TaskAllocationContract {
    interface View extends BaseView {
        void showAllocationList(List<TaskAllocationBean> list);

        void cancelReturnSucceed();

        void showError(String msg);
    }

    interface Model extends BaseModel {
        Disposable getAllocationList(String token,
                                     OnDataConvertListener<CommonPageBean<TaskAllocationBean>> listener);

        Disposable cancelReturn(String token, int repairId,
                                OnDataConvertListener<String> cancelListener,
                                OnDataConvertListener<CommonPageBean<TaskAllocationBean>> listener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void getAllocationList(String token);

        abstract void cancelReturn(String token, int repairId);
    }
}
